<!--
    /**
     * @author RaoShuang
     * @emil 991207823@qq.com
     * @date 2020/11/23 22:28
     */
-->
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>v-if与v-show</title>
		<script src="js/vuejs-2.5.16.js"></script>
	</head>
	<body>
		<div id="app">
            <span v-if="flag">传智播客</span>
            <br/>
            <span v-show="flag">itcast</span>
            <button @click="toggle">切换</button>
		</div>
	</body>
	<script>
		//view model
        new Vue({
            el: "#app",
            data: {
                flag: false
            },
            methods: {
                toggle: function () {
                    this.flag = !this.flag;
                }
            }
        });
	</script>
</html>
